<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        input[type="button"] {
            width: 100px;
            height: 50px;
            background-color: red;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            margin: 10px auto
        }
    </style>
    </style>
</head>

<body>
    <script>
        function handleClick() {
            console.log('button clicked');
        }
    </script>
    <input type="button" value="click me" id="btn" onclick="handleClick()"><br>
    <input type="button" value="click me2" id="btn2" onclick="console.log('button clicked2') ">


    <script>
        let btn = document.getElementById('btn');
        let btn2 = document.getElementById('btn2');
        btn.onclick = function () {
            console.log('js button clicked-------------');
        }
        btn.addEventListener('click', function () {
            console.log('js addEventListener button clicked-------------');
        });

    </script>
</body>

</html>